﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CaseProfileSupport.ascx.cs" Inherits="PayrollHR.Administration.Modules.CaseProfileSupport" %>
<%@ Register Src="ToolTipLabelControl.ascx" TagName="ToolTipLabelControl" TagPrefix="uc1" %>
<%@ Register Src="DatePicker.ascx" TagName="DatePicker" TagPrefix="uc2" %>
<%@ Register Src="DecimalTextBox.ascx" TagName="DecimalTextBox" TagPrefix="uc3" %>
<script type="text/javascript">
    function checkAll(objRef) {
        var GridView = objRef.parentNode.parentNode.parentNode;
        var inputList = GridView.getElementsByTagName("input");
        for (var i = 0; i < inputList.length; i++) {
            //Get the Cell To find out ColumnIndex
            var row = inputList[i].parentNode.parentNode;
            if (inputList[i].type == "checkbox" && objRef != inputList[i]) {
                if (objRef.checked) {
                    //If the header checkbox is checked
                    //check all checkboxes
                    //and highlight all rows
                    row.style.backgroundColor = "aqua";
                    inputList[i].checked = true;
                }
                else {
                    //If the header checkbox is checked
                    //uncheck all checkboxes
                    //and change rowcolor back to original
                    if (row.rowIndex % 2 == 0) {
                        //Alternating Row Color
                        row.style.backgroundColor = "#C2D69B";
                    }
                    else {
                        row.style.backgroundColor = "white";
                    }
                    inputList[i].checked = false;
                }
            }
        }
    }
    function MouseEvents(objRef, evt) {
        var checkbox = objRef.getElementsByTagName("input")[0];
        if (evt.type == "mouseover") {
            objRef.style.backgroundColor = "orange";
        }
        else {
            if (checkbox.checked) {
                objRef.style.backgroundColor = "aqua";
            }
            else if (evt.type == "mouseout") {
                if (objRef.rowIndex % 2 == 0) {
                    //Alternating Row Color
                    objRef.style.backgroundColor = "#C2D69B";
                }
                else {
                    objRef.style.backgroundColor = "white";
                }
            }
        }
    }
    function Check_Click(objRef) {
        //Get the Row based on checkbox
        var row = objRef.parentNode.parentNode;
        if (objRef.checked) {
            //If checked change color to Aqua
            row.style.backgroundColor = "aqua";
        }
        else {
            //If not checked change back to original color
            if (row.rowIndex % 2 == 0) {
                //Alternating Row Color
                row.style.backgroundColor = "#C2D69B";
            }
            else {
                row.style.backgroundColor = "white";
            }
        }

        //Get the reference of GridView
        var GridView = row.parentNode;

        //Get all input elements in Gridview
        var inputList = GridView.getElementsByTagName("input");

        for (var i = 0; i < inputList.length; i++) {
            //The First element is the Header Checkbox
            var headerCheckBox = inputList[0];

            //Based on all or none checkboxes
            //are checked check/uncheck Header Checkbox
            var checked = true;
            if (inputList[i].type == "checkbox" && inputList[i] != headerCheckBox) {
                if (!inputList[i].checked) {
                    checked = false;
                    break;
                }
            }
        }
        headerCheckBox.checked = checked;

    }
</script>
<asp:Button ID="btnDelete" runat="server" CssClass="adminButtonBlue" OnClick="btnDelete_Click" Text="<% $PayrollResources:Admin.CaseProfileSupport.Add.Text %>"
    ToolTip="<% $PayrollResources:Admin.CaseProfileSupport.Add.Tooltip %>" CausesValidation="False" />
<asp:GridView ID="gvObject" runat="server" AutoGenerateColumns="False" Width="100%"
    OnPageIndexChanging="gvObject_PageIndexChanging" AllowPaging="True"
    PageSize="12" OnRowDataBound="gvObject_RowDataBound"  OnRowDeleting="gvObject_RowDeleting">
    <Columns>
        <asp:TemplateField HeaderText="Giấy tờ cần thiết" ItemStyle-Width="17%">
            <ItemTemplate>
                <%#Server.HtmlEncode(Eval("PaperRequest").ToString())%>
            </ItemTemplate>

            <ItemStyle Width="17%"></ItemStyle>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Ngày Làm"
            HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="6%" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <%#Server.HtmlEncode(Eval("OnRequest").ToString())%>
            </ItemTemplate>

            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>

            <ItemStyle HorizontalAlign="Center" Width="6%"></ItemStyle>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Ngày Gửi"
            HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="6%" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <%#Server.HtmlEncode(Eval("DateSubmitted").ToString())%>
            </ItemTemplate>

            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>

            <ItemStyle HorizontalAlign="Center" Width="6%"></ItemStyle>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Đến Đâu"
            HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <%#Server.HtmlEncode(Eval("ProTo").ToString())%>
            </ItemTemplate>

            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>

            <ItemStyle HorizontalAlign="Center" Width="10%"></ItemStyle>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Cước Phí"
            HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <%#Server.HtmlEncode(Eval("Postage").ToString())%>
            </ItemTemplate>

            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>

            <ItemStyle HorizontalAlign="Center" Width="10%"></ItemStyle>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Hoàn Tất"
            HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <%#Server.HtmlEncode(Eval("ProComplete").ToString())%>
            </ItemTemplate>

            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>

            <ItemStyle HorizontalAlign="Center" Width="10%"></ItemStyle>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Ghi Chú"
            HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="26%" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <%#Server.HtmlEncode(Eval("Note").ToString())%>
            </ItemTemplate>

            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>

            <ItemStyle HorizontalAlign="Center" Width="26%"></ItemStyle>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="STK từ"
            HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="6%" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <%#Server.HtmlEncode(Eval("fromdate").ToString())%>
            </ItemTemplate>

            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>

            <ItemStyle HorizontalAlign="Center" Width="6%"></ItemStyle>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="STK đến"
            HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="6%" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <%#Server.HtmlEncode(Eval("todate").ToString())%>
            </ItemTemplate>

            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>

            <ItemStyle HorizontalAlign="Center" Width="6%"></ItemStyle>
        </asp:TemplateField>
        <%--<asp:TemplateField ItemStyle-Width="3%" ItemStyle-HorizontalAlign="Center">
            <HeaderTemplate>
                <asp:CheckBox ID="checkAll" runat="server" onclick="checkAll(this);" />
            </HeaderTemplate>
            <ItemTemplate>
                <asp:CheckBox ID="chkCheck" runat="server" onclick="Check_Click(this)" />
                <asp:HiddenField ID="hfProfileID" runat="server" Value='<%# Eval("ProfilePropertyID") %>' />
            </ItemTemplate>

            <ItemStyle HorizontalAlign="Center" Width="3%"></ItemStyle>
        </asp:TemplateField>--%>
        <asp:CommandField ShowDeleteButton="True" />
    </Columns>
    <PagerSettings PageButtonCount="50" Position="TopAndBottom" />
</asp:GridView>
<table>
    <tr>
        <td class="auto-style2">
            <uc1:ToolTipLabelControl runat="server" ID="lblPaperRequest" Text="<% $PayrollResources:Admin.CaseProfileSupport.PaperRequest.Text %>"
                ToolTip="<% $PayrollResources:Admin.CaseProfileSupport.PaperRequest.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td class="auto-style2">
            <uc1:ToolTipLabelControl runat="server" ID="lblOnRequest" Text="<% $PayrollResources:Admin.CaseProfileSupport.OnRequest.Text %>"
                ToolTip="<% $PayrollResources:Admin.CaseProfileSupport.OnRequest.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td class="auto-style2">
            <uc1:ToolTipLabelControl runat="server" ID="lblDateSubmitted" Text="<% $PayrollResources:Admin.CaseProfileSupport.DateSubmitted.Text %>"
                ToolTip="<% $PayrollResources:Admin.CaseProfileSupport.DateSubmitted.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td class="auto-style2">
            <uc1:ToolTipLabelControl runat="server" ID="lblProTo" Text="<% $PayrollResources:Admin.CaseProfileSupport.ProTo.Text %>"
                ToolTip="<% $PayrollResources:Admin.CaseProfileSupport.ProTo.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td class="auto-style2">
            <uc1:ToolTipLabelControl runat="server" ID="lblPostage" Text="<% $PayrollResources:Admin.CaseProfileSupport.Postage.Text %>"
                ToolTip="<% $PayrollResources:Admin.CaseProfileSupport.Postage.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td class="auto-style2">
            <uc1:ToolTipLabelControl runat="server" ID="lblProComplete" Text="<% $PayrollResources:Admin.CaseProfileSupport.ProComplete.Text %>"
                ToolTip="<% $PayrollResources:Admin.CaseProfileSupport.ProComplete.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td class="auto-style2">
            <uc1:ToolTipLabelControl runat="server" ID="lblFromdate" Text="<% $PayrollResources:Admin.CaseProfileSupport.Fromdate.Text %>"
                ToolTip="<% $PayrollResources:Admin.CaseProfileSupport.Fromdate.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
    </tr>
    <tr>
        <td>
            <asp:TextBox ID="txtPaperRequest" runat="server"></asp:TextBox>
        </td>
        <td>
            <uc2:DatePicker ID="dpOnRequest" Width="10px" runat="server" />
        </td>
        <td>
            <uc2:DatePicker ID="dpDateSubmitted" Width="10px" runat="server" />
        </td>
        <td>
            <asp:TextBox ID="txtProTo" runat="server"></asp:TextBox>
        </td>
        <td>
            <uc3:DecimalTextBox ID="txtPostage" runat="server" />
        </td>
        <td>
            <asp:TextBox ID="txtProComplete" runat="server"></asp:TextBox>
        </td>
        <td>
            <uc2:DatePicker ID="dpFromdate" Width="10px" runat="server" />
        </td>
    </tr>
    <tr>
        <td>
            <uc1:ToolTipLabelControl runat="server" ID="lblTodate" Text="<% $PayrollResources:Admin.CaseProfileSupport.Todate.Text %>"
                ToolTip="<% $PayrollResources:Admin.CaseProfileSupport.Todate.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td>
            <uc2:DatePicker ID="dpTodate" Width="10px" runat="server" />
        </td>
        <td>
            <uc1:ToolTipLabelControl runat="server" ID="lblNote" Text="<% $PayrollResources:Admin.CaseProfileSupport.Note.Text %>"
                ToolTip="<% $PayrollResources:Admin.CaseProfileSupport.Note.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td>
            <asp:TextBox ID="txtNote" runat="server" TextMode="MultiLine"></asp:TextBox></td>
        <td></td>
        <td style="text-align: right">
            <asp:Button ID="btnAdd" runat="server" CssClass="adminButtonBlue" OnClick="btnAdd_Click" Text="<% $PayrollResources:Admin.CaseProfileSupport.Add.Text %>"
                ToolTip="<% $PayrollResources:Admin.CaseProfileSupport.Add.Tooltip %>" CausesValidation="False" />
        </td>
        <td></td>
        <td></td>
        <td></td>
    </tr>
</table>






